<%--
    Document   : newpromotion
    Created on : Nov 17, 2011, 12:33:29 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*, Beans.ThamSoHT, Models.ThamSoHT_Model, Models.KhuyenMai_Model"%>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'updatesuc', 'checkdatepromotion', 'datemsg', 'save', 'checksubmitmsg', 'content', 'updatedetailpro', 'datestart', 'enddate', 'editpromotionday', 'notice', 'promotion', 'promotiontype', 'rightmsg', 'save', 'promotionname' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String checkdatepromotion = mdsts[0].getTenTS();
            String checksubmitmsg = mdsts[1].getTenTS();
            String content = mdsts[2].getTenTS();
            String datemsg = mdsts[3].getTenTS();
            String datestart = mdsts[4].getTenTS();
            String editpromotionday = mdsts[5].getTenTS();
            String enddate = mdsts[6].getTenTS();
            String notice = mdsts[7].getTenTS();
            String promotion = mdsts[8].getTenTS();
            String promotionname = mdsts[9].getTenTS();
            String promotiontype = mdsts[10].getTenTS();
            String rightmsg = mdsts[11].getTenTS();
            String save = mdsts[12].getTenTS();
            String updatedetailpro = mdsts[13].getTenTS();
            String updatesuc = mdsts[14].getTenTS();

            String msgsubmit = notice + "/" + checksubmitmsg;
            String msgright = notice + "/" + rightmsg;
            String msgcheckdatepromotion = notice + "/" + checkdatepromotion;
            String msgdate = notice + "/" + datemsg;
            String msgupdatesuc = notice + "/" + updatesuc;

            Vector v = (Vector) request.getAttribute("KM");
%>
<script type="text/javascript">
    $(function(){
        $('#datepicker1').datepicker($.datepicker.regional['vi']);
        $( "#datepicker1" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker2').datepicker($.datepicker.regional['vi']);
        $( "#datepicker2" ).datepicker( "option", "dateFormat","dd/mm/yy");
     });
</script>
<h1><img style="margin-right: 13px; opacity: 0.8; margin-top: 4px;" alt="" src="../images/promotion11.png"><%=promotion%></h1>
<div class="cb"></div>
<div id="DSKM" class="bloc" style=" margin-top: 15px;">
    <div class="title">
        <%=editpromotionday%>        
    </div>
    <div class="content">
        <form name="AddPromotion" action="">
            <%
                for(int i=0; i<v.size(); i++){
                    Beans.KhuyenMai km = (Beans.KhuyenMai) v.elementAt(i);%>
            <div style="float: left; width: 40%; height: 100%; margin-bottom: 15px; margin-left: 30px; margin-top: 15px;">
                <div style="width: 120px; float: left; margin-left: 5px; "><label><%=promotiontype%></label></div>
                <select name="promotiontype" class="text" onchange="LoaiKM(this.value)" style=" width: 180px; margin-bottom: 15px; padding-top: 3px; height: 27px;">
                    <option value="<%=km.getMaLKM() %>"><%=KhuyenMai_Model.LayTenLoaiKM( km.getMaLKM(), langid) %></option>
                </select>
                <br />
                <div style="width: 120px; float: left; margin-left: 5px; "><label><%=datestart%></label></div>
                <input type="text" style=" width: 180px; margin-bottom: 15px;" id="datepicker1" value="<%=km.getNgayBD() %>" class="text" name="datestart"/><br />
                <div style="width: 120px; float: left; margin-left: 5px; "><label><%=enddate%></label></div>
                <input type="text" style=" width: 180px; margin-bottom: 15px;" id="datepicker2" value="<%=km.getNgayKT() %>" class="text" name="enddate"/><br />
            </div>
            <div style="width: 53%; float: left; margin-top: 15px;">
                <div style="width: 120px; float: left; "><label><%=promotionname %></label></div>
                <input type="text" style=" width: 350px; margin-bottom: 15px;" value="<%=km.getTenKM() %>" class="text" name="promotionname"/><br />
                <div style="width: 120px; float: left; "><label><%=content%></label></div>
                <textarea class="textarea" name="content"  style=" height: 135px; width: 350px" ><%=km.getNoiDungKM() %>
                </textarea>
                <br />
            </div>
            <div class="cb"></div>
            <div style=" width: 30%; float: left;">
                <input type="hidden" id="updatesuccess" value="<%=msgupdatesuc%>">
                <input type="button" id="<%=msgsubmit%>" lang="<%=msgright%>" align="<%=msgdate%>" name="<%=msgcheckdatepromotion%>"  onclick="UpdateDetailPromotionDay( this.id, this.lang, this.alt, this.align, this.name)" alt="<%=km.getMaKM() %>" style="margin-left: 340px; margin-bottom: 25px; margin-top: 25px; " class="button" value="<%=save%>">
            </div>
            <div style=" width: 30%; float: left;">
                <input type="button" lang="<%=msgright%>" onclick="ShowDetailPromotionDay( this.lang, this.alt)" alt="<%=km.getMaKM() %>" style="margin-left: 160px; margin-bottom: 25px; margin-top: 25px; " class="button" value="<%=updatedetailpro%>">
            </div>
            
            <%  }
            %>
        </form>
    </div>
</div>

